package com.yh.patterns.combination.demo;

/**
 * @Auther:云尚学Java
 */
public abstract class OrganizationComponent {
    //菜单组件的名称
    protected String name;
    //菜单组件的层级
    protected int level;

    //添加子部门
    public void add(OrganizationComponent organizationComponent){
        throw new UnsupportedOperationException();
    }

    //移除子部门
    public void remove(OrganizationComponent organizationComponent){
        throw new UnsupportedOperationException();
    }

    //获取指定的子部门
    public OrganizationComponent getChild(int index){
        throw new UnsupportedOperationException();
    }

    //获取组织或者组织项的名称
    public String getName(){
        return name;
    }
}
